import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "home",
    component: () =>
      import(/* webpackChunkName: "home" */ "@/views/home/indexView.vue"),
  },
  {
    path: "/detail/:id/car/:name",
    name: "detail",
    component: () =>
      import(/* webpackChunkName: "detail" */ "@/views/detail/indexView.vue"),
    props: true,
  },
  {
    path: "/select/car",
    name: "selectCar",
    component: () =>
      import(
        /* webpackChunkName: "selectCar" */ "@/views/selectCar/indexView.vue"
      ),
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
